<?php
include("schlzi_status.php");
include("conf/config.php");
?>
<!doctype html>
<html>
<head>
   <title>Schlafzimmer</title>
   <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">    
    <script type='text/javascript' src="http://code.jquery.com/jquery-1.8.3.js"></script>
<script type='text/javascript' >
$(window).load(function(){
$("#slider").on("slidestop", function (event,ui) {
var value = event.target.value;

$.ajax({
   url : "http://<?php echo $ccuurl;?>/config/xmlapi/statechange.cgi",
   type : "GET",
   data: {ise_id: "<?php echo $temp_soll_schlzi;?>", new_value: value },
   dataType: "html"
  });	
  
});
});
</script>
<script type='text/javascript'>
function refreshPage() {
  $.mobile.changePage(
    window.location.href,
    {
      allowSamePageTransition : true,
      transition              : 'none',
      showLoadMsg             : false,
      reloadPage              : true
    }
  );
}
</script>
    <script type='text/javascript' src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.js"></script>
	<link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.css">
</head>

<body>
    <div data-role="page" id="schlzi" data-dom-cache="true">
 
        <div data-role="header">
		    <a href="index.php" data-role="button" data-iconpos="notext" data-direction="reverse" data-transition="slide" data-icon="back">Zur&uuml;ck</a>
            <h1>Schlafzimmer</h1>
			<a href="#" data-role="button" data-icon="refresh" data-iconpos="notext" onclick="refreshPage(); return false">Aktualisieren</a>
        </div><!-- /header -->
 
        <div data-role="content">
		<!--<h1>Aktuelle Werte</h1>-->
            <p>Temperatur Schlafzimer: <?php echo $temp;?> &deg;C</p>
			<form>
			<label for="slider">Soll Temperatur Schlafzimmer: <?php echo $soll;?> &deg;C</label>
			<input type="range" name="slider" id="slider" value="<?php echo $soll;?>" min="15" max="30" />
			</form>
	<p>Diagram Verlauf</p>
	
			<img src="grafik_schlzi.php">
			
        </div><!-- /content -->
 
      
 
    </div><!-- /page -->
</body>
</html>